package com.lkk.cg.util;

/**
 * Created by lkk on 2014/12/13.
 */
public class UrlUtils {

    public static String formatUrl(String url) {
        String privUrl = url;

        if (!privUrl.startsWith("/"))
            privUrl = "/" + privUrl;

        //去除查询参数
        int index = privUrl.indexOf('?');
        if (index != -1)
            privUrl = privUrl.substring(0, index);

        //去除UI后缀
        index = privUrl.indexOf("UI");
        if (index != -1)
            privUrl = privUrl.substring(0, index);

        return privUrl;
    }
}
